<!DOCTYPE>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>UEditor demo</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <script type="text/javascript" charset="utf-8" th:src="@{/uEditor/ueditor.config.js}"></script>
    <script type="text/javascript" charset="utf-8" th:src="@{/uEditor/ueditor.all.min.js}"> </script>
    <script type="text/javascript" charset="utf-8" th:src="@{/uEditor/lang/zh-cn/zh-cn.js}"></script>
    <script type="text/javascript" charset="utf-8" th:src="@{/js/jquery-3.3.1.min.js}"></script>

    <style type="text/css">
        .divButton {
            text-align: left;
            margin:6px;
        }
    </style>
</head>
<body>
<table width="800" border="0" align="center">
    <tr>
        <td align="center">
            <div>
                <h1>UEditor demo</h1>
                <script id="editor" type="text/plain"></script>
            </div>
            <div id="btns">
                <div class="divButton">
                    <button onclick="getAllHtml()">获得整个html的内容</button>
                    <button onclick="getContent()">获得内容</button>
                    <button onclick="setContent()">写入内容</button>
                    <button onclick="setContent(true)">追加内容</button>
                    <button onclick="getContentTxt()">获得纯文本</button>
                    <button onclick="getPlainTxt()">获得带格式的纯文本</button>
                    <button onclick="hasContent()">判断是否有内容</button>
                    <button onclick="setFocus()">使编辑器获得焦点</button>
                    <button onmousedown="isFocus(event)">编辑器是否获得焦点</button>
                </div>
                <div class="divButton">
                    <button onmousedown="setblur(event)" >编辑器失去焦点</button>
                    <button onclick="getText()">获得当前选中的文本</button>
                    <button onclick="insertHtml()">插入给定的内容</button>
                    <button id="enable" onclick="setEnabled()">可以编辑</button>
                    <button onclick="setDisabled()">不可编辑</button>
                    <button onclick=" UE.getEditor('editor').setHide()">隐藏编辑器</button>
                </div>
                <div class="divButton">
                    <button onclick=" UE.getEditor('editor').setShow()">显示编辑器</button>
                    <button onclick=" UE.getEditor('editor').setHeight(300)">设置高度为300默认关闭了自动长高</button>
                    <button onclick="getLocalData()" >获取草稿箱内容</button>
                    <button onclick="clearLocalData()" >清空草稿箱</button>
                    <button onclick="createEditor()">创建编辑器</button>
                    <button onclick="deleteEditor()">删除编辑器</button>
                </div>
            </div>
            <hr/>
            <div id="divApiCallInfo"></div>
            <div><textarea rows="5" cols="144" id="txtUEditorContent"></textarea></div>
            <hr/>
        </td>
    </tr>
</table>
</div>
<script type="text/javascript" charset="utf-8" th:src="@{/js/uEditorDemo.js}"></script>
</body>
</html>